package com.hakim.wfb.customer.service.task;

import com.hakim.wfb.bean.ConsumeRecord;
import com.hakim.wfb.common.util.DateUtils;

import java.util.Date;
import java.util.Timer;

/**
 * Created by Administrator on 2017/7/3.
 */
public class StaticProfitSchedule {

    private final static long ONE_DAY_SECOND = 24 * 60 * 60 * 1000;

    private Timer timer;

    public StaticProfitSchedule(ConsumeRecord consumeRecord, int canRunCount) {
        timer = new Timer();
        Date date = DateUtils.getNextDayTime(1);
        timer.schedule(new StaticProfitTask(timer, canRunCount, consumeRecord), date, ONE_DAY_SECOND);
        //timer.schedule(new StaticProfitTask(timer,canRunCount,consumeRecord), new Date(),5000);
    }
}
